package com.frank.feignDecoder.client;

import com.frank.feignDecoder.config.BusinessConfigInterceptor;
import com.frank.feignDecoder.config.BusinessTwoConfig;
import com.frank.feignDecoder.config.BusinessTwoConfigInterceptor;
import com.frank.globalException.domain.BaseResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author 小石潭记
 * @date 2020/10/22 10:14
 * @Description: ${todo}
 */
@FeignClient(
        //服务名
        name = "MyTwoFeignClient",
        //服务地址
        url = "http://localhost:8081/api",
        configuration = BusinessTwoConfigInterceptor.class

//        ,fallback = UserHihystric.class   暂不开启熔断
)
public interface MyTwoFeignClient {

    //对应的服务里的接口地址，及请求方式
    @RequestMapping(value = "/getUserInfo", method = RequestMethod.GET)
    @ResponseBody
    BaseResponse getUserInfo();

    @RequestMapping(value = "/getGradeInfo", method = RequestMethod.GET)
    @ResponseBody
    BaseResponse getGradeInfo();

    @RequestMapping(value = "/getFailInfo", method = RequestMethod.GET)
    @ResponseBody
    BaseResponse getFailInfo();

}
